package com.dmgis.qxfw.dataservice.businessservice.api.entity;

/**
 * @className Results
 * @Description TODO
 * @Author lhfy
 * @Version 1.0
 */
public class Results {
    private int code;
    private String msg;
    private int total;
    private Object data;

    private Results(int code, String msg, int total, Object data) {
        this.code = code;
        this.msg = msg;
        this.total = total;
        this.data = data;
    }


    public static Results fail(String msg) {
        return new Results(500,msg,0,null);
    }

    public static Results success(String msg, int total, Object data) {

        return new Results(200,msg,total,data);
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
